Python v3.7 HowTos:
Replace the last element in a list with another list
Find a tuple with smallest second index
L = [1, 2, 3, 4, 5, 6] last_idx = len(L) - 1 print(L[last_idx]) # 6
See also
https://www.w3resource.com/python-exercises/list/python-data-type-list-exercise-59.php